package com.example.moments.dao;

import androidx.room.Dao;
import androidx.room.Query;

import com.example.moments.ssmemo.entity.Comment;
import com.example.moments.ssmemo.entity.Content;

import java.util.List;

@Dao
public interface ContentDao extends BaseDao<Content> {

    @Query("DELETE FROM "+ Content.TABLE_NAME)
    void clearAll();

    @Query("SELECT * FROM " + Content.TABLE_NAME)
    List<Content> getAll();

    @Query("SELECT * FROM " + Content.TABLE_NAME + " where id = :id limit 1")
    Content getById(Long id);

//    是不是没有编译他就是红色的 id
    @Query("SELECT * FROM " + Content.TABLE_NAME + " WHERE id IN (:ids)")
    List<Content> loadAllByIds(Long[] ids);

//    @Query("SELECT * FROM " + Content.TABLE_NAME + " WHERE id IN (:ids)")
//    List<Content> getByCon(Long[] ids);
}
